Davison etal
rescheduling op i/o interrupts

ABSTRACT

TO EVALUATE COMPUTER SYSTEM PERFORMANCE, SOFTWARE TECHNIQUES ARE FREQUENTLY USED TO COLLECT DATA ON THE SYSTEM AS IT RUNS, AND/OR TO SIMULATE NEW DEVICES. HOWEVER, DATA COLLECTING, SIMULATING AND REPORT WRITING PROCEDURES DEGRADE THE PERFORMANCE OF THE SYSTEM ON WHICH THEY ARE RUN AND THEREFORE PROVIDE DISTORTED RESULTS. THE TECHNIQUE HEREIN IS DESIGNED TO HIDE THE OVERHEAD PROCEDURE FROM THE PERFORMANCE OF THE SYSTEM BY USING PRIOR ART PROCEDURES IN STOPPING THE SYSTEM CLOCK WHENEVER AN OVERHEAD PROGRAM IS BEING EXECUTED, AND ADDING TO THAT A TECHNIQUE FOR COMPENSATING FOR DISTRORTION IN THE I/O AREA BY INTERCEPTING AND RESCHEDULING I/O INTERRUPTS TO COMPENSATE FOR THE &#34;STOLEN&#34; TIME DURING WHICH THE SYSTEM CLOCK IS STOPPED THE PROCEDURE INVOLVES THE INTERCEPTION OF ALL I/O INSTRUCTIONS ISSUING FROM THE CPU TO THE CHANNEL AND INTERCEPTION OF ALL I/O INTERRUPTS FROM THE CHANNEL IN ORDER TO RESCHEDULE THEIR PRESENTATION TO THE OPERATING SYSTEM. THIS IS ACCOMPLISHED BY MEASURING THE LENGTH OF TIME THAT IS TAKES FOR THE I/O OPERATION TO BE PERFORMED AND, BY ADDING TO THAT TIME ANY &#34;STOLEN&#34; TIME TAKEN FROM THE OPERATING SYSTEM DURING THE PERIOD IN WHICH THE I/O OPERATION WAS OUTSTANDING, THE PRESENTATION OF THE INTERRUPT MAY BE DELAYED AN APPROPRIATE TIME. PROVISION IS MADE FOR SCHEDULING THE INTERRUPT IN ACCORDANCE WITH THE ABOVE CALCULATION, AND PROVISION IS ALSO MADE FOR FURTHER   DELAYING THE INTERRUPT IF ADDITIONAL TIME IS TAKEN BETWEEN INITIAL RESCHEDULING AND FINAL PRESENTATION

DEFENSIVE PUBLICATION UNITED STATES PATENT OFFICE Published at the request of the applicant or owner in accordance with the Notice of Dec. 16, 1969, 869 0.6. 687. The abstracts of Defensive Publication applications are identified by distinctly numbered'series and are arranged chronologically. The heading of each abstract indicates the number of pages of specification, including claims and sheets of drawings contained in the application as originally filed. The files of these applications are available to the public for inspection and reproduction may be purchased for 30 cents a sheet.

Defensive Publication applications have not been examined as to the merits of alleged invention. The Patent Omce makes no assertion as to the novelty of the disclosed subject matter.

PUBLISHED JANUARY 22, 1974 918 O.Gr. 1330 T918,015 RESCHEDULING 0F I/O INTERRUPTS Gerald A. Davison, Poughkeepsie, and Edward J. Nauss,

Millbrook, N.Y., assignors to International Business Machines Corporation, Armonk, N.Y.

Continuation of application Ser. No. 218,743, Jan. 18, 1972. This application July 25, 1973, Ser. No. 382,431 Int. Cl. G06f 7/00 US. Cl. 444-1 13 Sheets Drawing. 32 Pages Specification To evaluate computer system performance, software techniques are frequently used to collect data on the system as it runs, and/ or to simulate new devices. However, data collecting, simulating and report writing procedures degrade the performance of the system on which they are run and therefore provide distorted results. The technique herein is designed to hide the overhead procedure from the performance of the system by using prior art procedures in stopping the system clock whenever an overhead program is being executed, and adding to that a technique for compensating for distortion in the I/O area by intercepting and rescheduling I/O interrupts to compensate for the stolen time during which the system clock is stopped.

The procedure involves the interception of all I/O instructions issuing from the CPU to the channel and interception of all I/O interrupts from the channel in order to reschedule their presentation to the operating system. This is accomplished by measuring the length of time that it takes for the I/O operation to be performed and, by adding to that time any stolen time taken from the operating system during the period in which the I/O operation was outstanding, the presentation of the interrupt may be delayed an appropriate time. Provision is made for scheduling the interrupt in accordance with the above calculation, and provision is also made for further delaying the interrupt if additional time is taken between initial rescheduling and final presentation.

l-- I/O TRAPPED ENTRY FEFEFIKsEnTEuEEF/ I IIIITIATOR mm I/O OPERATION I comm moor nrsuums I /I3I FLAG CURRENT INTERCEPTOR TASK AS"NOT SELEDTABLE T IASII OUT INTERRUPTS FROM AN OPERATING SYSTEM IATTEMPTED (Ii TRAPPED) I [20 OPERATION I IORDEIT TII/IT LATER INTERRUPTS I- MIT RE RESOHEULELTIIERLTEL Y ACTIVE TASK T RETURN CONTROL TO HIGHEST PRIORITY SELEOTABLE TASK SAVE smusor CURRENTLY H ovmnous curur LA MASK IIITEROEPTOR INTERRUFTS REOUEST ENTRY PLACE CONTROL BLOCK ON I/O OPERATIONS OUEUE IF THIS IS AN OPERATING SYS- TEN I/O OPERATIOII,REOORO TASK (FRESEIITLY FLAGOED "NOT SELEOTABLE") AS 'SELEOTABLE" DEOUEUE TOOCB FROM I/O OPERATIONS OUEUE I I I I ENTEiFI/TSCHEDULER/ j I I INITIATOR WITH l/O OPER- I ATION CONTROL BLOCK i 1 RESULTING FROM AN INTER- cmoa REQUEST FOR AN I we EE E'E M] RECORD REAL STATUS OF CHANNEL, CONTROL UNIT, AND DEVICE TO REFLEOT START INSTRUCTION JUST EXECUTED Jan. 22,

G. A. DAVISON L RESCHEDULING 0F 1/0 INTERRUPTS Original Filed Jan. 18. 1972 I /O DEVICE DEVICE 1/0 DEVICE row-420 FIG. 1

l3 Sheets-Sheet 1 F'I IZZI IO Jan. 22, 1974 DAvISQN ETAL T918015 RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18, 1972 13 Sheets-Sheet 4 F G 3 Cl I/O TRAPPEO ENTRY /I5I FLAC CURRENT INT'ERCEPTOR TASK AS "NOT SELECTABLE" A MASK OUT INTERRUPTS I ENTER 1/0 scIIEOuIER/ INITIATOR wITII I/O OPERATION I CONTROL BLOCK RESULTING FROM AN OPERATINO sYsTEII IATTENIPTEO (A TRAPPED) 0 OPERATION w] IS I/O OPERATIONS OUEUE EMPTY WAIT TASK I I r AN I/O INTERRUPT WILL RETURN CONTROL TO HIGHEST I EVENTUALLY CAUSE CONTROL I 'PRIORITY SELECTABLE TASK TO RETURN TO POINT 5A w I44 ISEAITTTNGTIMETS mEFN I IORDER THAT LATER INTERRIIPTs P LOAN BE RESCHEDULED ACCURATEL Y J J 22 1974 O G. A. DAVISON ETAL. T9 IB,015

RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18. 1972 13 Sheets-Sheet 5 FIG. 3b

SAVE sTATus 0F OIIR'RENT Y MASK INTEROEPTOR AcTIvE TASK. INTERRuPTs REOuEsT ENTRY A I I 1 PLACE CONTROL BLOCK ON I/0 OPERATIONs OuEuE I A ISS | ENTER I/O SCHEDULER INITIATOR wITII 1/0 OP R- I I YES R L ATION CONTROL BLOCK I RESULTING FROM AN INTER- m OEPTOR REQUEST FOR AN 1 i fi'fi I CONTROL uNIT sTATus= sTART REQUESTED I/O OPERATION I57 7J8 IF THIS Is AN OPERATINO sIs- TEN I/O OPERATION, REOORO I59 THE STARTING TINIE IN THE 1/0 I I #"0PERAT|0N CONTROL BLOCK, RECORD REAL STATUS OF AND FLAG THE ASSOCIATED CHANNEL, CONTROL UNIT, ANO TASK(PRESENTLY FLAGGED DEVICE T0 REFLECT START NOT Q L AS INsTRIIOTION JUST ExEcuTEO SELECTABLE I OEOOEOE IOOCB FROM I/O OPERATIONS OOEOE Jan. 22, 1974 Original Filed Jan. 18. 1972 FIG. 40

1/0 INTERRUPT n51 TEMPORARILY STOP (SAVE VALUE OFI'SYSTEM'S HARDWARE CLOCK SAVE STATUS OF INTERRUPT'ED TASK AND RETURN PT w s OPERATING G. A. DAVISON AL RESCHEDULING OF I/O INTERRUPTS INTER l3 Sheets-Sheet 6 RECORD CHANGE IN REAL STATUS OF CHANNEL, CONTROL UNIT; AND

DEVICE SYSTEM OR INTERCEPTOR ACTIVE PERMANENTLY SAVE STORED VALUE OF BLOCK I51 SAVE RETURN PT 0F BLOCK I52 SEPARATELY IS I MODIFY RETURN PT ATBLOCK I52 TO POINT T0 BLOCK I64IFIC2) Jan. 22, 1974 Original Filed Jan. 18." 1972 v 13 Sheets-Sheet 7 FIG. 4b

LOCATE THE INTERCEPTOR-BUILT 1/0 OPERATIONS CONTROL BLOCK CORRESPONDING To THIS INTER- RUPT \m OP SYSTEM OR INTERCEPTOR OPERATION OPSYS BUILD 1/0 INTERRUPT CONTROL sET INDICATOR To SHOW THAT BLOCK FOR USE IN RESCHEDULING INTERCEPTOR'S I/O OPERATION THIS INTERRUPT HAS BEEN COMPLETED COMPUTE SIMULATED TIME THAT MUST ELAPSE BEFORE INTERRUPT Ls PRESENTED TO THE OPERATING SYSTEM= DELTA ER E5 R,s1o s, s 10 T \460 STORE IN I0 I c B CALL FUTURE EVENT SCHED'ULER FIG. 5 a PASS LT THE I /o INTERRUPT CONTROL BLOCK 164 162 IS I/O OPERATION COMPLETE YES OE-ALLOCATE STORAGE USED FOR THE I/O OPERATION CONTROL BLOCK G. A. DAVISON ETAL T918 015 Jan. 22, 1974 E RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18, 1972 F I G 5 ENTER FUTURE EVENT A FUTURE EVENT CONTROL BLOCK SCHEDULE}? ROUTINE I IS PASSED AS AN ARGUMENT TO I I THIS SUBROUTINE,WHICH MAINTAINS A CHA IN 0F FUTURE EVENT CTRL. F I BLOCKS. THE CHAIN IS ORDERED ACCORDING TO THE TIME AT WHICH I I THE EVENTS ARE DUE TO OCCUR J ADD CURRENT. ELAPSED mu- LATED TIME 'TO DELTA TIME (FOUND IN FUTURE EVENT CTRL BLOCK I TO GET TIME AT WHICH THIS FUTURE EVENT IS DUE TO OCCUR l3 Sheets-Sheet 8 INSERT THE NEW FUTURE EVENT CONTROL BLOCK AT THE APPRO- PRIATE POINT IN THE CHAIN OF v FUTURE EVENT CONTROL BLOCKS I74 wAs IT INSERTED AS FIRST m CHAIN SET UP CLOCKS TO GENERATE INTERRUPT WHEN THE NEW J 22 197 G. A. IDAVISON ETAL T918,015

RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18. 1972 l3 Sheets-Sheet 9 FIG. 6

HARDWARE CLOCK INTERRUPT RETURN TO PT OFv INTERRUPTION STOP (STORE VALUE OF I THE SYSTEM CLOCK SAVE STATUS OF INTERRUPTED TASK REMOVE FIRST EVENT FROM CHAIN INCLUDING RETURN PT. \482 OF FUTURE EVENTS. IT IS DUE TO 483 OCCUR NOW CALL APPROPRIATE ROUTINE TO HANDLE THIS TYPE OF FUTURE EVENT.(SEE FICT) COMPUTE TIME REMAINING UNTIL NEW FIRST EVENT. IS DUE TO OCCURSET UP HARDWARE CLOCK T0 CENERATE INTERRUPT AFTER THAT MUCH TIME HAS ELAPSED EXIT J 22, 1974 G. A. DAVISON AL T9l8,015

- RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18. 1972 13 Sheets-Sheet 10 MOVE & SAVE RETURN PT FOUND IN BLOCK I82 MODIFY RETURN PT AT I9I BLOCK 182 TO ADDRESS THE SYSTEM'S l/O INTERRUPT HANDLER PREPARE SAVED INTERRUPT 192 INFORMATION FOUND IN 1 IOICB USINC RETURN POINT SAVED IN BLOCK I90 FREE IOICB I95 RETURN TO FIG. 6 AT BLOCK RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18, 1972 FIG. 8

15 Sheets-Sheet 11 IOICB TEBCHN X USED FOR CHAINING BLOCKS TOGETHER TEBTME TIME OF INTERRUPT CONTAINS DELTA TIME WHEN BUILT, LATER CONTAINS SIMULATED TEBRTN ADDRESS OE ROUTINE TO PROCESS EVENT WHEN IT OCCURS IOICBCSW CSW FOR I/O INTERRUPT CSW (CONTINUED) IOICBDVC IOICBFB UNIT ADDRESS OF FLAGS NOT USED INTERRUPTINC DEVICE (FORMAT FOR OS OPERATION FROM TRAPPED SIO) CPCBCHN RESERVED FOR I/O SCHEDULER TO CHAIN IOICB'S TOCETHER CPCBFLCS NOT USED FLACS NOT USED CPCBCAW I/O PROTECT CHANNEL PROGRAM ADDRESS KEY CPCBRTIM TIME CLOCK AT 510 (ER s ,SIO I VALUE OF REAL TIME CLOCK AT SEO -VALUE OF SIMULATED Jan. 22, 1974 G. A. DIAVISON ET L RESCHEDULING OFv I/O INTERRUP'IS Original Filed Jan. 18, 1972 l3 Sheets-Sheet' 12 FIG.9B 100GB FORMAT FOR INTERCEPTOR I /O OPERATIONS CPCBSENS CPCBCHN SENSE DATA CPCBFLGS CPCBECB SENSE DATA mes RELATIVE ECB NUMBER CPGBCAW 1/0 PROTECT CHANNEL PROGRAM ADDRESS KEY CPGBCSW c s w c s w CPCBPCI POI APPENDAGE ROUTINE ADDRESS OPTIONAL FIG. DVCB (DEVICE CONTROL BLOCK) DVCBCHN POINTER T0 L CB 0R 1 0068 x 00 DVCBUNAD DVCBFLGS UNIT ADDRESS mes nvcacoca DVCBROT DVGBHASH coca ROTATION TIMING POINTER POINTER HASH PONTER BELOW IS AN ALTERNATE FORMAT OF THE DVCBCHN FIELD NOT USED Jan. 22, 1974 G. A. DAVISON ErAT. T918,015

RESCHEDULING OF I/O INTERRUPTS Original Filed Jan. 18. 1972 13 Sheets-Sheet 1:5

FIG 11 CHCB CHANNEL CONTROL BLOCK CHCBPEND x 00' POINTER To 1ST PENDING IOICB CHCBFLGS CIHCBSIMB CHCBDS CHCBTPD CHANNEL SIMULATED BUSY, REALLY BUSY) FLAGS SIMULATED REALLY BUSY, 0 INTERCEPTOR BUSY INTERRUPT USED LAST ExPEcTE0,0s USED LAST cRcBoLEN oRoRsN CHCBCUB CHANNEL ouEuE SYSTEM MASK coNTRoL uNTT LENGTH BIT FOR CHANNEL BLOCKAGE couNT P CHANNEL OUEUE ENTRY NUMBER OF DUEUE ENTRTEs oNE FOR 0s ME FOR EACH lNTERcEPToR DEVICE L FIG. 12 COCB CONTROL UN IT CONTROL BLOCK COCBLBID POINTER To A CHAIN 0F IOICB'S FOR LOCKED BID KEYS COCBFLGS COCBBASE GOGBFLGX F A CONTROL UNIT FLAGS L Gs BASE ADDRESS 

